package com.ruoyi.ams.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.ams.domain.AmsAssetProcess;
import com.ruoyi.ams.mapper.AmsAssetProcessMapper;
import com.ruoyi.ams.service.IAmsAssetProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流程控制Service业务层处理
 * 
 * @author yfkj
 * @date 2022-05-16
 */
@Service
public class AmsAssetProcessServiceImpl extends ServiceImpl<AmsAssetProcessMapper, AmsAssetProcess>  implements IAmsAssetProcessService
{
    @Autowired
    private AmsAssetProcessMapper amsAssetProcessMapper;

    /**
     * 查询流程控制
     * 
     * @param assetProcessId 流程控制主键
     * @return 流程控制
     */
    @Override
    public AmsAssetProcess selectAmsAssetProcessByAssetProcessId(Long assetProcessId)
    {
        return amsAssetProcessMapper.selectAmsAssetProcessByAssetProcessId(assetProcessId);
    }

    /**
     * 查询流程控制列表
     * 
     * @param amsAssetProcess 流程控制
     * @return 流程控制
     */
    @Override
    public List<AmsAssetProcess> selectAmsAssetProcessList(AmsAssetProcess amsAssetProcess)
    {
        return amsAssetProcessMapper.selectAmsAssetProcessList(amsAssetProcess);
    }

    /**
     * 新增流程控制
     * 
     * @param amsAssetProcess 流程控制
     * @return 结果
     */
    @Override
    public int insertAmsAssetProcess(AmsAssetProcess amsAssetProcess)
    {
        amsAssetProcess.setCreateTime(System.currentTimeMillis());
//        amsAssetProcess.setCreateBy(SecurityUtils.getUsername());
        return amsAssetProcessMapper.insertAmsAssetProcess(amsAssetProcess);
    }

    /**
     * 修改流程控制
     * 
     * @param amsAssetProcess 流程控制
     * @return 结果
     */
    @Override
    public int updateAmsAssetProcess(AmsAssetProcess amsAssetProcess)
    {
        amsAssetProcess.setUpdateTime(System.currentTimeMillis());
//        amsAssetProcess.setUpdateBy(SecurityUtils.getUsername());

        return amsAssetProcessMapper.updateAmsAssetProcess(amsAssetProcess);
    }

    /**
     * 批量删除流程控制
     * 
     * @param assetProcessIds 需要删除的流程控制主键
     * @return 结果
     */
    @Override
    public int deleteAmsAssetProcessByAssetProcessIds(Long[] assetProcessIds)
    {
        return amsAssetProcessMapper.deleteAmsAssetProcessByAssetProcessIds(assetProcessIds);
    }

    /**
     * 删除流程控制信息
     * 
     * @param assetProcessId 流程控制主键
     * @return 结果
     */
    @Override
    public int deleteAmsAssetProcessByAssetProcessId(Long assetProcessId)
    {
        return amsAssetProcessMapper.deleteAmsAssetProcessByAssetProcessId(assetProcessId);
    }
}
